import { TaskBase } from '../TaskBase';

export class TaskRepair extends TaskBase {
    shouldRun(creep: Creep): boolean {
        if (!('structureType' in this.target)) {
            return false;
        }
        const target = <Structure>this.target;
        return target.hits < target.hitsMax;
    }
    _run(creep: Creep) {
        return this.defaultProcess(creep.repair(<Structure>this.target));
    }
}